<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>eval</title>
</head>

<body>
  <script>
    // console.log(eval("'aa' && 'bb'"));
    const geval = eval
    let x = "global"
    function f() {
      let x = 'local';
      console.log(eval("x"));
      geval("x += 'changed'");
      return x
    }
    console.log(eval("x.toString()"));
    console.log(f(), x);
    // console.log(eval("var y = 3 ;"));


    let b = [1, 2, 3]
    let res = b.join('+')
    console.log(res);
    console.log(eval(res));

  </script>
</body>

</html>